<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
	xmlns:f="http://xmlns.jcp.org/jsf/core"
	xmlns:h="http://xmlns.jcp.org/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:pe="http://primefaces.org/ui/extensions"
	xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
	template="/WEB-INF/templates/public/default.xhtml">

	<f:metadata>
		<f:viewParam name="feedBackId" value="#{feedBackHome.id}"></f:viewParam>
		<f:event listener="#{feedBackHome.initConversation()}"
			type="preRenderView"></f:event>
	</f:metadata>

	<ui:define name="content">

		<div class="sub_wrap">
			<div class="Methbox_tit">
				<h2>意见反馈</h2>
				<span><p:link outcome="/index.xhtml" target="_blank">
				平台首页</p:link> &gt;意见反馈</span>
			</div>
			<div class="Methbox_con">
				<h:form id="editForm">
					<p:messages id="messages" />
					<p:panel id="baseInfo" style="margin-bottom:10px;"
						styleClass="nureg-cont nuregcbox nuregcboxsty">

						<h:panelGrid columns="2" cellpadding="5">
							<p:outputLabel for="title" value="标题" />
							<p:inputText id="title"
								value="#{feedBackHome.instance.title}" styleClass="input-large" required="true">
							</p:inputText>
							<p:outputLabel for="content" value="内容" />
							<pe:ckEditor id="content" value="#{feedBackHome.instance.content}" required="true" width="100%"></pe:ckEditor>
							
							<p:outputPanel>
								<p:outputLabel
									for="images"
									value="相关截图"
								/>
						</p:outputPanel>
							<p:fileUpload
								id="images"
								mode="advanced"
								skinSimple="true"
								fileLimit="4"
								fileLimitMessage="最多只能上传四张截图"
								allowTypes="/(\.|\/)(jpe?g|png)$/"
								sizeLimit="#{1024 * 1024 * 3}"
								uploadLabel="上传"
								cancelLabel="取消"
								update="@form:images"
								fileUploadListener="#{feedBackHome.uploadImages}"
							></p:fileUpload>
							
							<p:outputLabel for="contactorPhoneNumber" value="常用手机号" />
							<p:inputText id="contactorPhoneNumber" value="#{feedBackHome.instance.contactorPhoneNumber}"  />
								
							<p:outputLabel for="email" value="邮箱" />
							<p:inputText id="email"
								value="#{feedBackHome.instance.email}" required="true">
							</p:inputText>
							
						</h:panelGrid>
					</p:panel>

					<p:commandButton action="#{feedBackHome.saveAndFlush()}" value="提交" ajax="true" update="@form" />
					<p:commandButton action="#{feedBackHome.cancel()}" value="取消" immediate="true"></p:commandButton>

				</h:form>
			</div>
		</div>
	</ui:define>

</ui:composition>
